cmake_minimum_required(VERSION 2.6)
PROJECT(pushserver)

AUX_SOURCE_DIRECTORY(./ SRC)
AUX_SOURCE_DIRECTORY(./socket SRC_SOCK)
AUX_SOURCE_DIRECTORY(../base/pb/protocol SRC_PROTO)
AUX_SOURCE_DIRECTORY(../base/log4z SRC_LOG)



#SET(LIBRARY_OUTPUT_PATH ./)
SET(EXECUTABLE_OUTPUT_PATH  ./)

ADD_DEFINITIONS( -g -W -Wall -D_REENTRANT -D_FILE_OFFSET_BITS=64 -DAC_HAS_INFO
-DAC_HAS_WARNING -DAC_HAS_ERROR -DAC_HAS_CRITICAL -DTIXML_USE_STL
-DAC_HAS_DEBUG -DLINUX_DAEMON -std=c++11)

INCLUDE_DIRECTORIES(./ ../base/pb/protocol ../base/log4z /usr/local/protobuf/include)
LINK_DIRECTORIES(./ /usr/local/protobuf/lib)

#ADD_XXXX必须在TARGET_LINK_LIBRARIES前面，否则会报错
#ADD_LIBRARY(${PROJECTNAME} SHARED/STATIC ${SRC_LIST})
ADD_EXECUTABLE(push_server ${SRC} ${SRC_SOCK} ${SRC_PROTO} ${SRC_LOG})

TARGET_LINK_LIBRARIES(push_server pthread protobuf-lite ssl)
